/**
 * JAVACC DEMO 1.0
 */
package com.apache.portal.common.enums;

import com.apache.tools.StrUtil;

/**
 * description:  信息发布枚举
 *
 * @author Hou Dayu 创建时间：2016-8-29
 */
public enum InfoMethodEnum {

    Add("R0001"), Edit("R0002"), Del("R0003"), List("R0004"), Pages("R0005"), Count("R0006"), View(
            "R0007"), Check("R0008"), editNoticeStatus("R0009"), Fsave("Fsave"), Fedit(
            "Fedit"), Fdel("Fdel"), Flist("Flist"), Fpages("Fpages"), Fcount("Fcount"), Fview(
            "Fview"), Msave("Msave"), Medit("Medit"), Mdel("Mdel"), Mlist("Mlist"), Mpages(
            "Mpages"), Mcount("Mcount"), Mview("Mview"), Subsave("Ssave"), Subeidt("Sedit"), Subdel(
            "Sdel"), Sublist("Slist"), Subpages("Spages"), Subcount("Scount"), Subview(
            "Sview"), ufsql("ufsql"), saveSortInfo("saveSortInfo"), delSortInfo(
            "delSortInfo"), listSortInfo("listSortInfo"), publish("publish"), sotp(
            "stop"), saveMetadata("saveMetadata"), delMetadata("delMetadata"), listMetadata(
            "listMetadata"), initCache("initCache"),createDatabase("createDatabase"), Default("R000");

    private String name;

    private InfoMethodEnum(String name) {
        this.name = name;
    }

    // 普通方法
    public static InfoMethodEnum getName(String name) {
        if (StrUtil.isNull(name))
            return Default;
        for (InfoMethodEnum c : InfoMethodEnum.values()) {
            if (c.getName().equals(name)) {
                return c;
            }
        }
        return Default;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
